package com.alks.function.controller.finance.fincons;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.RoleCheck;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.finance.fincons.SettlementPayableRequest;
import com.alks.function.service.finance.fincons.SettlementPayableService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Slf4j
@Api(value = "财务部-工厂-财务咨询查询", tags = {"财务部-结算应付查询"})
@ApiRestController("/SettlementPayable")
@RoleCheck(prgIds = {"100503","180503"})
public class SettlementPayableController {

    @Autowired
    private SettlementPayableService settlementPayableService;

    @PostMapping("/getSettlementSummary")
    @ApiOperation(value = "结算应付汇总查询，所有金额计算和",tags = "财务部-结算应付查询")
    public ResponseInfo getSettlementSummary(@RequestBody SettlementPayableRequest request) {
        return settlementPayableService.getSettlementSummary(request);
    }

    @PostMapping("/getSettlementDetails")
    @ApiOperation(value = "结算应付明细查询，数量、金额",tags = "财务部-结算应付查询")
    public ResponseInfo getSettlementDetails(@RequestBody SettlementPayableRequest request) {
        //双击汇总查询就穿厂商和结算月份
        return settlementPayableService.getSettlementDetails(request);
    }

}
